# # 继承语法
# class A:
#     def __init__(self):
#         self.name = 'python'
#         self.age = 22
# class B(A):
#     pass
# b= B()
# # print(b.name)
# # print(b.age)
# class Person:
#
#     def talk(self):
#         print('会吃饭')
#
# class pig:
#     def call(self):
#         print('猪叫')
#
# class Larrpage(Person,pig):
#     pass
# # c1 = Larrpage()
# # c1.talk()
# # c1.call()
# class Goods:
#     def __init__(self):
#         self.name = '商品'
#
# #     def fn(self):
# #         return self.name
# class Goods:
#     def __init__(self,name,price):
#         self.name = name
#         self.price = price
#     def info(self):
#         print(f'名字:{self.name}, 单价:{self.price}')
#
# class Phone(Goods):
#     def __init__(self, name , price, brand,os):
#
#         super().__init__(name,price)
#         self.brand = brand
#         self.os = os
#     def info(self):
#         super().info()
#         print(self.brand)
#         print(self.os)
# pr = Phone('iphone14', 1999, 'apple', 'ios')
# print(pr.name)
# print(pr.price)
# print(pr.brand)
# print(pr.os)
# #
# # class Person:
# #     def __init__(self,name,age):
# #         self.name = name
# #         self._age = age
# #     def get(self):
# #         return self._get
# # p1 = Person('小羊','18')
# # print(p1._age)
# # print(p1.name)
# # # # print(p1.age)
# class Person:
#     country = 'china'
#     @classmethod
#     def get_country(cls):
#         print(cls.country)
#     @classmethod
#     def fn(cls):
#         print(cls)
class Person:
    @staticmethod
    def fn():
        print('这是一个静态方法')
    @staticmethod
    def fn1(cls):
        print(cls.fn)
#静态方法调用
#类调用静态方法
Person.fn1()
#对象调用静态方法
Person1 = Person()
Person1.fn()




# Person.get_country()
# print(Person)
# p1 = Person()
# p1.get_country()
# p1.fn()